1. Field of the Invention
The present invention relates, generally, to the use of command I/O control block (IOCB) entries to facilitate communications between a host and a host interface port, and in particular embodiments, to a new format for command IOCB entries that reduces the number of direct memory access (DMA) operations required by the host interface port to read and execute a command.
2. Description of Related Art
A generalized representation of an exemplary conventional computing system is illustrated in FIG. 1. A computer or server identified generally herein as a host 100 is connected to a host bus 102 (e.g. a PCI-X bus). The host 100 typically includes one or more host processors 104, cache 106, and main memory 108. Also attached to the host bus 102 is at least one port (e.g. a host bus adapter (HBA), an I/O controller, or the like), which is configured by its firmware as an interface to the host 100 and referred to generally herein as a host interface port 110. The host interface port allows communications between the host 100 and one or more targets 124 across a network 122 using protocols such as Fibre Channel (FC), Serial Attached SCSI (SAS), and Serial ATA (SATA). The host 100 and the host interface ports 110 may all reside within the same chassis. The host 100 and the host interface port 110 must frequently communicate over the host bus 102. Two main messaging mechanisms are typically provided for enabling such communications. One mechanism is a mailbox 120, which handles asynchronous commands. For example, the host 100 may send a mailbox command to the host interface port 110, and wait for it to be completed and passed back. During this time, no other mailbox command can be executed. Another mechanism utilizes command rings 112 and response rings 122 in main memory 108, which may comprise a circular queue or other data structure that performs a similar function. In general, rings are used to pass information across the host bus 102 between the host 100 and the host interface port 110. For example, the host 100 may ask for service from the host interface port 110 via a command written into a command ring 112 in main memory 108 of the host 100. When the host interface port 110 reads the command from the command ring 112, it processes the command, and when the command is complete the host interface port 110 writes a response into the response ring 122.
The command ring 112 stores command blocks or representations such as command IOCBs 114 that are to be presented to the host interface port 110. In conventional command IOCB formats, each command IOCB 114 has a relatively small fixed size (e.g. eight 32-bit words, or 32 bytes). A command IOCB 114 contains a pointer that can be used to obtain all of the command information needed by the host interface port 110 to carry out a command. When the host 100 writes a command IOCB 114 into the command ring 112, it also increments an index known as a put pointer 116 to indicate that a new command IOCB 114 has been placed into the command ring 112. When the host interface port 110 reads a command IOCB 114 from the command ring 112, it increments a get pointer 118 to indicate that a command IOCB 114 has been read from the command ring 112. In general (excluding for the moment the fact that the command ring 112 is a circular ring that wraps around), if the put pointer 116 is equal to the get pointer 118, the command ring 112 is empty. If the put pointer 116 is ahead of the get pointer 118, there are commands 114 in the command ring 112 to be read by the host interface port 110. If the put pointer 116 is one less than the get pointer 118, the command ring 112 is full. When the firmware in the host interface port 110 reads the values of the get pointer 118 and put pointer 116 and determines that there is a command IOCB 114 to be read from the command ring 112, it performs a DMA operation to read the command IOCB 114.
Referring now to the example of FIG. 2, to process a command IOCB 220, a host interface port must perform a DMA operation to read the command IOCB 220 from command ring 200 in the main memory of a host. By reading the command IOCB 220, a buffer list pointer 202 is obtained that points to a buffer list 204 stored in main memory.
The host interface port must then perform a second DMA operation to read the contents of the buffer list 204, which includes a command buffer pointer 206, a response buffer pointer 208, and one or more data buffer pointers 210. The command buffer pointer 206 points to a command buffer 212 stored in main memory, the response buffer pointer 208 points to a response buffer 214 stored in main memory, and the one or more data buffer pointers 210 point to one or more data buffers 216 stored in main memory. The command buffer 212 contains command arguments for communications between the host and a remote target. The response buffer 214 contains a zero if the target did not encounter any anomalies when processing the command. However, if the target detects an anomaly, it writes nonzero status information into the response buffer 214. The one or more data buffers 216 store the command data. The command, response and data buffers and their associated pointers are generally identified collectively or individually herein as command information.
The host interface port must then perform a third DMA operation to read the contents of the command buffer 212. In addition, depending on the type of command, the host interface port may have to perform additional DMA operations to read the contents of the one or more data buffers 216. Each of these DMA operations contributes to the overall inefficiency in processing commands between the host and the host interface port.
It should also be noted that in conventional command IOCB formats, a Last Entry (LE) bit 218, which was historically utilized for other purposes, is set equal to one in every command IOCB to indicate that the command IOCB supports the processing of 64-bit buffer descriptor entries (BDEs) which include an address, length, and flag byte.
However, with the advent of 64-bit addressing, the relatively small fixed size of a command IOCB in conventional formats (e.g. only eight words or 32 bytes) is generally insufficient to hold all of the information (e.g. control codes, command arguments and the like) needed to process commands between the host and the host interface port. In addition, as mentioned above, each command IOCB requires at least three DMA operations to extract the command information.
Therefore, there is a need for a new command IOCB format to hold all of the information needed in a command, and to reduce the number of DMA operations needed to read all of the information in a command.